/*
* ============================================================================
* 功能描述 ：GPIO模拟I2C功能温湿度
* 作者       ：ggls
* 创建日期 ：2024.04.24
* ----------------------------------------------------------------------------
* 更新历史 ：
*	日期 　　- 修改者   : 更新内容描述
*
* ============================================================================
*/

#ifndef __HLY_I2C_TEMP_H__
#define __HLY_I2C_TEMP_H__


#include "main.h"

#define  SCL_H_temp  	RB4 = 1
#define  SCL_L_temp  	RB4 = 0
#define  SCL_OUT_temp  	TRISB4 = 0
#define  SCL_IN_temp	TRISB4 = 1

#define  SDA_H_temp  	RB5 = 1
#define  SDA_L_temp  	RB5 = 0
#define  SDA_OUT_temp  	TRISB5 = 0
#define  SDA_IN_temp	TRISB5 = 1


void TEMP_I2C_Start(void);
void TEMP_I2C_Gpio_Init(void);
void TEMP_I2C_Stop(void);
void TEMP_read_ACK(void);
void TEMP_I2C_init();
void TEMP_write_byte(unsigned char date);
unsigned char TEMP_read_byte() ;
void TEMP_write_add(unsigned char address,unsigned char date) ;
unsigned char TEMP_read_add(unsigned char address,char ACK);
void TEMP_send_ACK(char ACK);
void TEMP_write_MultipleByte(unsigned char address,unsigned char length,unsigned char *date);
void TEMP_read_MultipleByte(unsigned char *temp,unsigned char address,unsigned char data_size) ;


#endif


